/*
 * SonarQube
 * Copyright (C) 2009-2017 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
@import (reference) "../variables";
@import (reference) "../mixins";
@import (reference) "../components/ui";

.vertical-top    { vertical-align: top; }
.vertical-bottom { vertical-align: bottom; }
.vertical-middle { vertical-align: middle; }

.nowrap { white-space: nowrap; }
table.nowrap td, td.nowrap, th.nowrap { white-space: nowrap; }

.hidden {
  display: none !important;
  visibility: hidden !important;
}

.note {
  color: @secondFontColor;
  font-size: @smallFontSize;

  a {
    color: @secondFontColor;
  }
}

.spacer-left   { margin-left: 8px; }
.spacer-right  { margin-right: 8px; }
.spacer-bottom { margin-bottom: 8px; }
.spacer-top    { margin-top: 8px; }

.big-spacer-left   { margin-left: 16px; }
.big-spacer-right  { margin-right: 16px; }
.big-spacer-bottom { margin-bottom: 16px; }
.big-spacer-top    { margin-top: 16px; }

.huge-spacer-top     { margin-top: 40px; }
.huge-spacer-left    { margin-left: 40px; }

.little-spacer-left   { margin-left: 4px; }
.little-spacer-right  { margin-right: 4px; }
.little-spacer-bottom { margin-bottom: 4px; }
.little-spacer-top    { margin-top: 4px; }

td.spacer-left   { padding-left: 8px; }
td.spacer-right  { padding-right: 8px; }
td.spacer-bottom { padding-bottom: 8px; }
td.spacer-top    { padding-top: 8px; }

td.big-spacer-left   { padding-left: 16px; }
td.big-spacer-right  { padding-right: 16px; }
td.big-spacer-bottom { padding-bottom: 16px; }
td.big-spacer-top    { padding-top: 16px; }

.pull-left  { float: left !important; }
.pull-right { float: right !important; }

.bordered        { border: 1px solid @barBorderColor; }
.bordered-left   { border-left: 1px solid @barBorderColor; }
.bordered-right  { border-right: 1px solid @barBorderColor; }
.bordered-bottom { border-bottom: 1px solid @barBorderColor; }
.bordered-top    { border-top: 1px solid @barBorderColor; }

.overflow-hidden { overflow: hidden; }

.width-100 { width: 100%; }
.width-80 { width: 80%; }
.width-60 { width: 60%; }
.width-55 { width: 55%; }
.width-50 { width: 50%; }
.width-40 { width: 40%; }
.width-30 { width: 30%; }
.width-25 { width: 25%; }
.width-20 { width: 20%; }
.width-15 { width: 15%; }
.width-10 { width: 10%; }

.abs-width-240 { width: 240px; }
.abs-width-300 { width: 300px; }
.abs-width-400 { width: 400px; }

.justify {
  margin-bottom: -1em;
  text-align: justify;

  & > .ib { display: inline-block; }
  &:after { display: inline-block; width: 100%; content: " "; }
}

.first-letter-uppercase::first-letter {
  text-transform: uppercase;
}

.disabled-pointer-events {
  pointer-events: none !important;
}

.display-inline-block {
  display: inline-block;
}

.rounded {
  border-radius: 2px;
}

.flex-1 {
  flex: 1;
}

.space-between {
  justify-content: space-between !important;
}

.new-loading {
  opacity: 0.5;
  transition: opacity 0.5s ease;
}

.slash-separator {
  margin-left: 5px;
  margin-right: 5px;

  &:after {
    content: "/";
    color: rgba(68, 68, 68, 0.3);
  }
}

.capitalize {
  text-transform: capitalize;
}

.cursor-not-allowed {
  cursor: not-allowed;
}


// Background Color

.bg-variant(@color, @fontColor: #fff) {
  background-color: @color;
  color: @fontColor;
}

.bg-danger  { .bg-variant(@red); }
.bg-warning { .bg-variant(@orange); }
.bg-info    { .bg-variant(@blue); }
.bg-success { .bg-variant(@green); }
.bg-muted   { .bg-variant(@barBackgroundColor, inherit); }
